package com.vecspace.data.model;

import java.io.IOException;

import com.vecspace.utils.PinYinUtil;

/**名称类。只记录id和名称
 */
public class NameItem {
	private Object id;
	private String name;
	private String parentId;
	public NameItem(){
		
	}
	
	public NameItem(String id, String name){
		this.id = id;
		this.name = name;
	}
	
	public NameItem(String id, String name, String parentId){
		this.id = id;
		this.name = name;
		this.parentId = parentId;
	}
	public Object getId() {
		return id;
	}
	public void setId(Object id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getPinyin(){
		String py;
		try {
			py = PinYinUtil.getFirstZimu(name);
			return py;
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "";
	}
}
